package com.ukee.birthday.modules.controller;

import com.ukee.birthday.modules.entity.StaffEntity;
import com.ukee.birthday.modules.entity.SysUserEntity;
import org.apache.shiro.SecurityUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * Controller公共组件
 *
 * @author Mark sunlightcs@gmail.com
 */
public abstract class AbstractController {
	protected Logger logger = LoggerFactory.getLogger(getClass());

//	protected SysUserEntity getUser() {
//		return (SysUserEntity) SecurityUtils.getSubject().getPrincipal();
//	}
//	protected Long getUserId() {
//		return getUser().getUserId();
//	}

	protected StaffEntity getUser() {
		System.out.println(SecurityUtils.getSubject().getPrincipal());
		return (StaffEntity) SecurityUtils.getSubject().getPrincipal();
	}

	protected Long getUserId() {
		return getUser().getId();
	}
}
